<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" autocomplete="off" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}" placeholder="请输入公司名称">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">企业编号<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-code" data-rule="required" autocomplete="off" class="form-control" name="row[code]" type="text" value="{$row.code|htmlentities}" placeholder="请输入企业编号">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">发包方联系电话<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-concat_phone" autocomplete="off" data-rule="required|mobile" class="form-control" name="row[concat_phone]" type="text" value="{$row.concat_phone|htmlentities}" placeholder="请输入公司联系电话">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">企业邮箱:</label>
        <div class="col-xs-12 col-sm-8">
            <input placeholder="请输入企业邮箱" autocomplete="off" id="c-email" data-rule="email" class="form-control" name="row[email]" type="text" value="{$row.email|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">省市县<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8" id="c-region" data-toggle="cxselect" data-selects="province,city,area">
            <select class="province form-control"  name="row[province]"  data-url="ajax/area" data-value="{$row.province}">
            </select>
            <select class="city form-control" name="row[city]" data-url="ajax/area" data-value="{$row.city}"></select>
            <select class="area form-control" name="row[area]"  data-url="ajax/area" data-value="{$row.area}"></select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">是否认证<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            {:Form::radios('row[identificationswitch]', ['未认证', '已认证'], $row.identificationswitch)}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">是否为独立商户<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            {:Form::radios('row[is_has_spread]', ['否', '是'], $row.is_has_spread)}
        </div>
    </div>

    <div class="form-group">
        <label class="col-xs-3 col-sm-2 control-label">
            税源地配置
        </label>
        <div class="col-xs-12 col-sm-8 am-u-end">
            <div class="am-scrollable-horizontal">
                <table class="table table-bordered table-striped regional-table am-table-centered am-margin-bottom-xs" style="border:2px solid #d2d6de;">
                    <tbody>
                    <tr>
                        <td colspan="5" class="am-text-left">
                            <a class="add-region btn btn-success" href="javascript:;">
                                <i class="fa fa-plus"></i>
                                点击选择税源地
                            </a>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <!-- 商品多规格sku信息 -->
                <div class="goods-sku scrollable-horizontal rate-click" id="rate_content" >
                    <!-- 分割线 -->
                    <div class="goods-spec-line"></div>

                </div>
            </div>

        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">经营状态<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            {:Form::radios('row[management]', ['不在业', '在业'], $row.management)}

        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Credit_code')}<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-credit_code"  autocomplete="off" placeholder="请输入企业统一社会信用代码" data-rule="required" class="form-control" name="row[credit_code]" type="text" value="{$row.credit_code}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Business_scope')}<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-business_scope" autocomplete="off" class="form-control " placeholder="请输入企业经营范围" rows="5" name="row[business_scope]" cols="50">{$row.business_scope|htmlentities}</textarea>
        </div>
    </div>



    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Detail')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-detail" class="form-control" placeholder="请输入公司联系地址" name="row[detail]" type="text" value="{$row.detail|htmlentities}">
        </div>
    </div>



    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>



<script id="rate-area" type="text/html">
    <div style="padding: 10px">
        <div class="panel panel-default">
            <div class="panel-body">
                <div class="checkbox row" style="padding: 1px 10px">
                    <% for(var i=0; i<rate_area.length; i++){ %>
                    <label class="col-xs-6 col-sm-5" for="<%=rate_area[i].id%>">
                        <!--判断是否选择了-->
                        <% if (rate_area[i].checked) { %>
                        <input class="rate_area_ids" checked id="<%=rate_area[i].id%>" name="rate_area_ids[]" type="checkbox" value="<%=rate_area[i].id%>_<%=rate_area[i].name%>"> <%=rate_area[i].name%>

                        <% } else { %>
                        <input class="rate_area_ids" id="<%=rate_area[i].id%>" name="rate_area_ids[]" type="checkbox" value="<%=rate_area[i].id%>_<%=rate_area[i].name%>"> <%=rate_area[i].name%>
                        <% } %>
                    </label>
                    <% } %>
                </div>
            </div>
        </div>
    </div>
</script>

<script id="rate-c" type="text/html">
    <!-- sku table -->
    <table class="spec-sku-tabel table table-bordered table-centered margin-bottom-xs text-nowrap" id="rate-table">
        <tbody>
        <tr>
            <th>税源地名称</th>
            <th>服务费率</th>
            <th>月限额</th>
            <th>月提醒</th>
            <th>年提醒</th>
            <th>是否审核</th>
        </tr>
        <% for(var i=0; i<newData.length; i++){ %>
        <tr>
            <td style="width: 160px;overflow-x: scroll">
                <%=newData[i].name%>
                <input type="hidden" name="rate_c[<%=i%>][rate_area_id]" value="<%=newData[i].rate_area_id%>">
            </td>
            <td>
                <input style="width: 150px" type="text" name="rate_c[<%=i%>][evaluation_expression]" data-rule="required" value="<%=newData[i].evaluation_expression%>" class="am-field-valid">
            </td>
            <td>
                <input style="width: 80px" type="number" name="rate_c[<%=i%>][limit_money]" data-rule="required" value="<%=newData[i].limit_money%>" class=" am-field-valid">
            </td>
            <td>
                <input  style="width: 80px" type="number" name="rate_c[<%=i%>][month_tip]" data-rule="required" value="<%=newData[i].month_tip%>" class=" am-field-valid">
            </td>
            <td>
                <input style="width: 80px" type="number" name="rate_c[<%=i%>][year_tip]" data-rule="required" value="<%=newData[i].year_tip%>" class=" am-field-valid">
            </td>
            <td>
                <div class="radio">
                    <label for="rate_c-0">
                        <input id="rate_c-0" <%= (newData[i].is_check==0) ? 'checked' : '' %> name="rate_c[<%=i%>][is_check]" type="radio" value="0"> 是
                    </label>
                    <label for="rate_c-1">
                        <input id="rate_c-1" <%= (newData[i].is_check==1) ? 'checked' : '' %> name="rate_c[<%=i%>][is_check]" type="radio" value="1"> 否
                    </label>
                </div>
            </td>
            <td>
                <button type="button" class="btn btn-default btn-xs rate-remove" data-index="<%=i%>">移除</button>
            </td>
        </tr>
        <% } %>
        </tbody>
    </table>
</script>


